Ext.onReady(function(){
   var root=new Ext.tree.AsyncTreeNode({
    id:"root",
    text:"根节点",
    children:[
     {
      text:"系统管理",
      children:[
       {text:"用户管理",leaf:true,id:1},
       {text:"系统设置",leaf:true,id:2}
      ]
     },{
      text:"业务管理",
      children:[
       {text:"考勤管理",leaf:true,id:3},
       {text:"行动管理",leaf:true,id:4}
      ]
     }
    ]
   });
   var tree=new Ext.tree.TreePanel({
    root:root,//设置为根节点
    renderTo:"hello",
    width:200,
    listeners:{
    click : function(node,e){
            alert(node.id); 
            //跳转测试
            if(node.id==2)
                location.href = "http://www.baidu.com";
        
        
    }
    }
       
   });
   tree.expandAll();            //展开所有节点
   //Ext.QuickTips.init();     //只显示根节点
});